# Contributor: Shinlun Hsieh <yngwiexx@yahoo.com.tw>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=fuseiso
pkgver=20070708
pkgrel=8
pkgdesc="FUSE module to mount ISO filesystem images"
arch=('loong64' 'x86_64')
url="https://sourceforge.net/projects/fuseiso/"
license=('GPL')
depends=('fuse2' 'glib2' 'zlib')
makedepends=('pkgconfig')
source=("https://ubiz.ru/dm/${pkgname}-${pkgver}.tar.bz2"
	00-support_large_iso.patch
	01-fix_typo.patch
	02-prevent-buffer-overflow.patch
	03-prevent-integer-overflow.patch)
md5sums=('4bb50412b6d01f337565e28afddca3a5'
         'f48d99f3928c6caf62fc1d58c99b31ed'
         'd5b5f328f4dc23a7a97b46b09d30e48c'
         'fcc34d91eeab5e243c4ac7768b9f3c4c'
         'f2bacb988113ac28a71e3f136c61c4bf')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # Patchset from debian
  patch -Np1 -i "${srcdir}"/00-support_large_iso.patch
  patch -Np1 -i "${srcdir}"/01-fix_typo.patch
  patch -Np1 -i "${srcdir}"/02-prevent-buffer-overflow.patch
  patch -Np1 -i "${srcdir}"/03-prevent-integer-overflow.patch

  ./configure --prefix=/usr
  make
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}

  make DESTDIR=${pkgdir} install
}
